/**
 * Trunghieu 
 */

DemoPortlet = Class.extend({
	init : function(){
		this.name = "DemoPortlet";
	},
	
	onReloadPage: function()	{
		this.run();
	},
	
	run: function(){
		this.getPortletPlaceholder().paintCanvas('');
		var loggedin = SingletonFactory.getInstance(Application).getSystemProperties().get('user.login');
		if (loggedin == 1)	{
			return;
		}
		this.getPortletPlaceholder().drawToCanvas(this.render());
		//console.log("slide");
		$(this.requestForEffectiveResource('Slide')).anythingSlider({
		 	width: 960,
		 	hashTags: false,
		 	navigationFormatter : function(index, panel){ // Format navigation labels with text
				return ['Đăng ký', 'Tìm kiếm', 'Đặt câu hỏi', 'Trả lời câu hỏi'][index - 1];
			}
		 }); // add any non-default options here
//		this.getPortletPlaceholder().getCanvas().access().css("margin-left","-18px"); 
//		$('#bkp_middle_main').css('width','100%');
	}
}).implement(RenderInterface).implement(PortletInterface); 